package com.zp.self.module.level_5_设计模式.行为型模式.Ⅲ_命令模式;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author ：by Zeng Peng
 * @date ：Created 2022/7/2 17:10
 * @description ：
 */
public class Client {

    public static void main(String[] args) {

        System.out.println("-------------1号桌点餐--------------");
        Order order =new Order();
        order.setDiningTable(1);
        Map<String,Integer> map = new HashMap<>();
        map.put("西红柿炒蛋",1);
        map.put("青椒炒肉",2);
        order.setFoodDic(map);
        OrderCommand orderCommand1 = new OrderCommand(order,new SeniorChef());

        System.out.println("-------------2号桌点餐--------------");
        Order order2 =new Order();
        order2.setDiningTable(2);
        Map<String,Integer> map2 = new HashMap<>(map);
        map2.put("烤乳鸽",1);
        order2.setFoodDic(map2);
        OrderCommand orderCommand2 = new OrderCommand(order2,new SeniorChef());

        List<Command> commands = new ArrayList<>();
        commands.add(orderCommand1);
        commands.add(orderCommand2);

        System.out.println("-------------点餐完毕，准备处理订单--------------");
        Waitor waitor = new Waitor();
        waitor.setCommand(commands);
        waitor.orderUp();
    }
}
